package lang;

/**
 * Created by foredawn on 15-8-28.
 * compare方法的变化
 */
public class Compare {

    public static void main(String[] args) {
        old();
        new7();
    }

    /**
     * java7以前compare比较两个对象
     */
    public static void old() {
        System.out.println(Integer.valueOf(10).compareTo(Integer.valueOf(11)));

    }

    /**
     * java7中的compare方法简化
     */
    public static void new7() {
        System.out.println(Integer.compare(10, 11));

    }
}
